#include <stdio.h>

#define N 1000

int arr_even[N] = {};
int arr_odd[N] = {};

int main(int argc, char const *argv[])
{
    int input_num = 1;
    int even_num = 0;     // 偶数个数
    int odd_num = 0;      // 奇数个数
    int even_sum = 0;     // 偶数总和
    int odd_sum = 0;      // 奇数总和
    int even_average = 0; // 偶数平均值
    int odd_average = 0;  // 奇数平均值

    while (input_num)
    {
        scanf("%d", &input_num);
        printf("输入的数字为(输到0代表结束)：%d\n", input_num);

        if (input_num % 2 == 0 && input_num != 0)
        {
            arr_even[even_num] = input_num;
            even_num++;
        }
        else if (input_num % 2 != 0 && input_num != 0)
        {
            arr_odd[odd_num] = input_num;
            odd_num++;
        }
    }

    for (int i = 0; i < even_num; i++)
    {
        even_sum += arr_even[i];
    }
    for (int i = 0; i < odd_num; i++)
    {
        odd_sum += arr_odd[i];
    }

    even_average = even_sum / even_num;
    odd_average = odd_sum / odd_num;

    printf("\n");
    printf("输入的偶数个数为：%d,输入的奇数个数为：%d\n 偶数的平均值为：%d,奇数的平均值为：%d\n", even_num, odd_num, even_average, odd_average);

    return 0;
}
